<%-- 
    Document   : list
    Created on : Dec 9, 2014, 2:03:25 PM
    Author     : martin.krasa
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%--@elvariable id="tournament" type="com.martinkrasa.golftourweb.site.entity.Tournament" --%>
<%--@elvariable id="results" type="List<com.martinkrasa.golftourweb.site.entity.TournamentResult>" --%>

<template:main title="Tournament results">
    <h2><c:out value="${tournament.name}" /></h2>
    <c:choose>
        <c:when test="${results.size() > 0}">
            <table>
                <tr>
                    <th>Rank</th>
                    <th>Player name</th>
                    <th>Club</th>
                    <th>Card ID</th>
                    <th>Brutto</th>
                    <th>Netto</th>
                    <th>Result</th>
                </tr>
                <c:forEach items="${results}" var="result">
                    <tr>
                        <td><c:out value="${result.rank}" /></td>
                        <td><c:out value="${result.playerName}" /></td>
                        <td><c:out value="${result.clubAbbreviation}" /></td>
                        <td><c:out value="${result.cardId}" /></td>
                        <td><c:out value="${result.bruttoResult}" /></td>
                        <td><c:out value="${result.nettoResult}" /></td>
                        <td><c:out value="${result.result}" /></td>
                    </tr>
                </c:forEach>
            </table>
        </c:when>
        <c:otherwise>
            <h6>There are no records in this tournament.</h6>
        </c:otherwise>
    </c:choose>
</template:main>
